readme.txt

Perspectives on Politics Dataverse Replication materials: 
Distelhorst and Fu, "Performing Authoritarian Citizenship" 


********************************************
Files and folder structure

./
letters.dta            Several thousand letters to Mayor's Mailbox
performing_repl.do     STATA script to analyze sample, prep for R
performing_map.R       Generates the map figure
performing_topics.R    Generates the topics table
regionalyb2014.dta     Prefectural data from China Regional Yearbook 2014
stopwords.txt          Chinese stopwords to remove for topic analysis

./china_shapefiles/    Contains GADM shapefiles for the map figure



********************************************
Replicating tables and figures

** Step 1. STATA scripts (Developed on STATA 14.2)

Set working directory to the folder containing performing_repl.do

. do performing_repl.do

This command generates:
Table_1_letter_sample.csv   In- and out-sample summary table
samplemap.dta               Used for the map figure
weights.dta                 Prefectural weights based on letter volume



** Step 2. R scripts (Developed on R 3.5.1)

Many non-base R packages needed for mapping and topic analysis.
Please review the scripts and install the packages before running.

. source("performing_map.R", echo=T)

This command generates:
Figure_1_sample_map.pdf     Map summarizing the letter sample

. source("performing_topics.R", echo=T)

This command generates:
Table_2_topics.csv          Table summarizing topic models


********************************************
Author contact information - Aug 2018

Greg Distelhorst
g.distelhorst@utoronto.ca
www.gregdistelhorst.com

Diana Fu
diana.fu@utoronto.ca
www.dianafu.org
